import { getRequest, postRequest, deleteRequest } from '@/request/http'

export const getTableList = function () {
  return getRequest('/api/profiles')
}

export const addData = function (data) {
  return postRequest('/api/profiles/add', data)
}

export const editData = function (id, data) {
  return postRequest(`/api/profiles/edit/${id}`, data)
}

export const deleteData = function (id) {
  return deleteRequest(`/api/profiles/delete/${id}`)
}

/*************** 首页 *************/

// 获取人员疏散通道
export const getRysstdData = function (params) {
  return postRequest(`/api/v1/houses/rysstdqk?code=110`, params)
}
// 获取人员疏散通道 msg
export const getRysstdMsgData = function (params) {
  return postRequest(`/api/v1/houses/rysstdqkmsg?code=110`, params)
}

// 电动自行车违规情况
export const getDDzxcwgqkData = function (params) {
  return postRequest(`/api/v1/houses/ddzxcwgqk?code=110000`, params)
}
// 电动自行车违规情况 -- msg
export const getDDzxcwgqkMsgData = function (params) {
  return postRequest(`/api/v1/houses/ddzxcwgqkmsg?code=110000`, params)
}
// 电动自行车违规情况 -- 更多
export const getDDzxcwgqkMoreData = function (params) {
  return postRequest(`/api/v1/houses/ddzxcwgqktable?code=110000`, params)
}

// 护栏拆除情况
export const getHlccqkData = function (params) {
  return postRequest(`/api/v1/houses/hlccqk?code=110000`, params)
}
// 护栏拆除情况 -- msg
export const getHlccqkMsgData = function (params) {
  return postRequest(`/api/v1/houses/hlccqkmsg?code=110000`, params)
}

// 宣传警示开展情况
export const getXcjskzqkData = function (params) {
  return postRequest(`/api/v1/houses/xcjskzqk?code=110000`, params)
}
// 宣传警示开展情况 --msg
export const getXcjskzqkMsgData = function (params) {
  return postRequest(`/api/v1/houses/xcjskzqkmsg?code=110000`, params)
}
// 充电设施配比情况
export const getCdsspbqkData = function (params) {
  return postRequest(`/api/v1/houses/clycdsspbqk?code=110000`, params)
}
// 清理液化石油气情况
export const getQlyhsyqqkData = function (params) {
  return postRequest(`/api/v1/houses/qlyhsyqqk`, params)
}
// 清理液化石油气情况 -- 更多
export const getQlyhsyqqkMoreData = function (params) {
  return postRequest(`/api/v1/houses/qlyhsyqqktable`, params)
}

// 头部卡片
export const getTopCardData = function (params) {
  return postRequest(`/api/v1/houses/dp_21zcjc`, params)
}

// 基础信息
export const getBaseInfoData = function (params) {
  return getRequest(`/api/v1/houses/dp_23jcxx?xzqdm=${params.code}`, params)
}
// 基础信息-二级
export const getBaseInfoData2 = function (params) {
  return postRequest(`/api/v1/houses/dp_23jcxx2j?xzqdm=${params.code}`,params)
}
// 基础建设情况
export const getBaseJSInfoData = function (params) {
  return getRequest(`/api/v1/houses/dp_24jcjsqk`, params)
}
// 基础建设情况-二级
export const getBaseJSInfoData2 = function (params) {
  return postRequest(`/api/v1/houses/dp_24jcjsqk2j?xzqdm=${params.code}`, params)
}


// 自查覆盖率
export const getFglData = function (params) {
  return postRequest(`/api/v1/houses/dp_31fgv`, params)
}
//  自查覆盖率 - 2级
export const getFglData2 = function (params) {
  return postRequest(`/api/v1/houses/dp_31fgv2j`, params)
}

// 隐患发现率
export const getYhfxlData = function (params) {
  return postRequest(`/api/v1/houses/dp_32yhfxl`, params)
}
// 隐患发现率 - 2级
export const getYhfxlData2 = function (params) {
  return postRequest(`/api/v1/houses/dp_32yhfxl2j`, params)
}

// 隐患整改率
export const getYhzglData = function (params) {
  return postRequest(`/api/v1/houses/dp_33yhzgl`, params)
}

// 隐患整改率 - 2级
export const getYhzglData2 = function (params) {
  return postRequest(`/api/v1/houses/dp_33yhzgl2j`, params)
}

// 隐患类型分析
export const getYhlxfxData = function (params) {
  return postRequest(`/api/v1/houses/dp_34yhlxf`, params)
}

//隐患类型数据
export const getYhlxList = function(params){
  return postRequest(`/api/v1/houses/dp_34yhlxf_yh`,params)
}

//获取行政树状结构
//获取行政单位
export const getRegionTree = function(params){
  return getRequest(`/api/v1/admin/district-tree/GetRegionTree`,params)
}

//获取隐患类型房屋检查记录
export const getDpYhlxfAllYh = function(params){
  return postRequest(`/api/v1/houses/dp_34yhlxf_allyh`,params)
}

//房屋信息
export const getDpYhlxfAllYhCheck = function(params){
  return getRequest(`/api/v1/houses/${params}/checkmsg`)
}


///api/v1/houseszc/rysstd：自查
export const getZcRysstd = function(params){
  return postRequest(`/api/v1/houseszc/rysstd`,params)

}
// /api/v1/housescjjc/rysstd：村级检查
export const getCjRysstd = function(params){
  return postRequest(`/api/v1/housescjjc/rysstd`,params)
}
// /api/v1/housesjzhc/rysstd：街镇核查
export const getJzRysstd = function(params){
  return postRequest(`/api/v1/housesjzhc/rysstd`,params)
}
// /api/v1/housesqjhc/rysstd：区级核查
export const getQjRysstd = function(params){
  return postRequest(`/api/v1/housesqjhc/rysstd`,params)
}
// /api/v1/housessjhc/rysstd：市级核查
export const getSjRysstd = function(params){
  return postRequest(`/api/v1/housessjhc/rysstd`,params)
}


// /api/v1/houseszc/dblbar：自查
export const getZcBblbar = function(params){
  
  return postRequest(`/api/v1/houseszc/dblbar`,params)
}
// /api/v1/housescjjc/dblbar：村级检查
export const getCjBblbar = function(params){
  return postRequest(`/api/v1/housescjjc/dblbar`,params)
}
// /api/v1/housesjzhc/dblbar：街镇核查
export const getJzBblbar = function(params){
  return postRequest(`/api/v1/housesjzhc/dblbar`,params)
}
// /api/v1/housesqjhc/dblbar：区级核查
export const getQjBblbar = function(params){
  return postRequest(`/api/v1/housesqjhc/dblbar`,params)
}
// /api/v1/housessjhc/dblbar：市级核查
export const getSjBblbar = function(params){
  return postRequest(`/api/v1/housessjhc/dblbar`,params)
}



// /api/v1/houseszc/searchcj-dbfw：自查
// /api/v1/housescjjc/searchcj-dbfw：村级检查
// /api/v1/housesjzhc/searchcj-dbfw：街镇核查
// /api/v1/housesqjhc/searchcj-dbfw：区级核查
// /api/v1/housessjhc/searchcj-dbfw：市级核查
// Limit		Int	页大小
// pageindex		int	页码，从0开始
// code
// 		Int	村代码
// isdb
// 		Int	1达标，2不达标
export const zcSearchcjDbfwData = function(params){
  return postRequest(`/api/v1/houseszc/searchcj-dbfw`,params)
}

export const cjSearchcjDbfwData = function(params){
  return postRequest(`/api/v1/housescjjc/searchcj-dbfw`,params)
}

export const jzSearchcjDbfwData = function(params){
  const {Limit,pageindex,code,isdb} = params
  return postRequest(`/api/v1/housesjzhc/searchcj-dbfw`,params)
}

export const qjSearchcjDbfwData = function(params){
  return postRequest(`/api/v1/housesqjhc/searchcj-dbfw`,params)
}

export const sjSearchcjDbfwData = function(params){
  return postRequest(`/api/v1/housessjhc/searchcj-dbfw`,params)
}